/*    */ package com.querycenter.serviceimpl;

/*    */
/*    */ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
/*    */ import java.util.List;
/*    */ import org.apache.ibatis.session.SqlSession;
/*    */ import org.apache.ibatis.session.SqlSessionFactory;
/*    */ import org.mybatis.spring.SqlSessionFactoryBean;
/*    */ import org.mybatis.spring.SqlSessionUtils;
/*    */ import org.springframework.beans.factory.annotation.Autowired;

/*    */
/*    */ public class BaseServiceImpl
/*    */ {
	/*    */ private static final long serialVersionUID = 1293567786956029903L;
	/*    */
	/*    */ @Autowired
	/*    */ protected SqlSessionFactoryBean sqlSessionFactory;

	/*    */
	/*    */ protected List<?> getPageList(Class<?> mapperClass, String sqlId,
			Object sqlParameter, int pageIndex, int pageSize)
					/*    */ throws Exception
	/*    */ {
		/* 25 */ SqlSession session = null;
		/*    */ try {
			/* 27 */ SqlSessionFactory sessionFactory = this.sqlSessionFactory
					.getObject();
			/* 28 */ session = SqlSessionUtils.getSqlSession(sessionFactory);
			/* 29 */ if (pageIndex <= 0) {
				/* 30 */ pageIndex = 1;
				/*    */ }
			/* 32 */ if (pageSize <= 0) {
				/* 33 */ pageSize = 10;
				/*    */ }
			/* 35 */ PageBounds pageBounds = new PageBounds(pageIndex,
					pageSize);
			/* 36 */ return session.selectList(
					mapperClass.getName() + "." + sqlId, /* 37 */ sqlParameter,
					pageBounds);
			/*    */ } finally {
			/* 39 */ session.close();
			/*    */ }
		/*    */ }
	/*    */ }

/*
 * Location:
 * C:\Users\Administrator\Desktop\bakclass\querycenter\WEB-INF\classes\
 * Qualified Name: com.querycenter.serviceimpl.BaseServiceImpl JD-Core Version:
 * 0.6.2
 */